package rrrmai.viewmodel;

import android.arch.lifecycle.ViewModel;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Flowable;
import rrrmai.repository.ContactRepository;
import rrrmai.repository.PostRepository;
import rrrmai.viewbinder.Contact;
import rrrmai.viewbinder.Post;

/**
 * Created by summer on 2018/3/20.
 */
public class ContactViewModel extends ViewModel{


    protected ContactRepository repo;

    @Inject
    public ContactViewModel(ContactRepository repo) {
        this.repo=repo;
    }

    public Flowable<List<Contact>> getContactList(int page, int pageSize) {
        return repo.getContactList(page,pageSize);
    }

    public Long[]  insert(List<Contact>  obj) {
        return repo.insert(obj);
    }

    public Long[] insert(Contact ... obj) {
       return  repo.insert(obj);
    }

    public int delete(Contact ... obj) {
       return repo.delete(obj);
    }

    public int update(Contact ... obj) {
        return repo.update(obj);
    }
}
